package com.itgungnir.designpattern.factory.simplefactory;

import java.util.Scanner;

import com.itgungnir.designpattern.factory.car.BMW;

public class Test {
	private static BMW bmw;

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		System.out.println("请选择要生产的汽车的型号：");
		System.out.println("1、BMW 523");
		System.out.println("2、BMW 320");
		int type = scanner.nextInt();

		bmw = FactoryBMW.createBMW(type);
		if (bmw != null) {
			bmw.introduce();
		} else {
			System.out.println("没有这个车型！");
		}

		scanner.close();
	}
}